//封装登录接口

import {request} from '@/utils/request'
import type { User,UserInfo } from '@/types/user'


export const loginBypasswordAPI=(mobile:string,password:string)=>{
    return request<User>('/login/password','post',{mobile,password})
}


//封装发送短信验证码接口
export const sendCodeAPI=(mobile:string,type:string)=>{
    return request<User>('/code','get',{mobile,type})
}

//封装短信验证码登录
export const loginByCodeAPI=(mobile:string,code:string)=>{
    return request<User>('/login','post',{mobile,code})
}


//个人中心获取信息
export const getUserInfo = () => {
    return request<UserInfo>('/patient/myUser','get')
}

